/*
 * @Author: Jiagang Chen
 * @Date: 2021-11-11 13:52:35
 * @LastEditors: Jiagang Chen
 * @LastEditTime: 2021-12-01 02:17:17
 * @Description: ...
 * @Reference: ...
 */

#ifndef SRC_ALTIMETER_CONVERTER_H
#define SRC_ALTIMETER_CONVERTER_H

#include <string>
#include "kaist_publisher/converter.h"

namespace kaist_publisher {

class AltimeterConverter : public Converter {
public:
    typedef std::shared_ptr<AltimeterConverter> Ptr;
    AltimeterConverter(ros::NodeHandle& nh, const std::string& dataset_dir,
                       const std::string& save_dir, const std::string& topic);
    virtual ~AltimeterConverter() = default;

    int Convert() override;

    std::string default_data_file = "sensor_data/altimeter.csv";

    int64_t Init_Publish();
    int64_t Publish();
    void Publish(int64_t& timestamp, lci_slam::altimeterPtr& altimeter_data);

    ros::Publisher pub_altimeter_;
    FILE* fp_;
    int64_t stamp_;
    double altimeter_value_;

private:
    std::string topic_;
    std::string bag_name_;
};

}  // namespace kaist_publisher

#endif  // SRC_ALTIMETER_CONVERTER_H
